import React from 'react';
import { Route, Redirect, Switch} from 'react-router-dom';
// import routerConfig from './config.js';

const RouterView = (config) => {
    return <Switch>
                {
                    config.routers.map((item,index)=>{
                        return <Route path={item.path} component={item.component} key={index}></Route>
                    })
                }
                <Redirect to='/home'></Redirect>
          </Switch>
}

export default RouterView
